package com.crealth.model;

import java.io.Serializable;

import com.alibaba.fastjson.JSONObject;

public class LendingAgencyModel implements Serializable {
	private static final long serialVersionUID = 2801816L;
	
	private int id;
	private String bankName;
	private int orderNum;
	
	public LendingAgencyModel() {
		id = 0;
		bankName = "";
		orderNum = 100;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}	
	public String getBankName() {
		return bankName;
	}
	public void setBankName(String bankName) {
		this.bankName = bankName;
	}
	public int getOrderNum() {
		return orderNum;
	}
	public void setOrderNum(int orderNum) {
		this.orderNum = orderNum;
	}
	
	public JSONObject toJSONObject() {
		JSONObject jsonObj = new JSONObject();
		jsonObj.put("id", this.id);
		jsonObj.put("bankName", bankName);
		jsonObj.put("orderNum", orderNum);
		
		return jsonObj;
	}
	
	public void parseFromJson(JSONObject jsonData) {
		if (jsonData.containsKey("id")) {
			id = jsonData.getIntValue("id");
		}
		if (jsonData.containsKey("bankName")) {
			bankName = jsonData.getString("bankName");
		}
		if (jsonData.containsKey("orderNum")) {
			orderNum = jsonData.getIntValue("orderNum");
		}
	}
	

}
